package cn.beyond.vehicleManagement.dao;
import cn.beyond.vehicleManagement.pojo.VehicleDeprecition;
import cn.beyond.vehicleManagement.util.DataBaseUtil;

import java.util.List;
import java.util.Map;

public class VehicleDeprecitionDao {
    DataBaseUtil<VehicleDeprecition> vehicleDeprecitiondao=new DataBaseUtil<>();

    /**
     * 添加车辆折旧
     * @return
     */
    public int addVehicleDeprecition(VehicleDeprecition vehicleDeprecition){
        return    vehicleDeprecitiondao.addUtil(vehicleDeprecition,"vehicle_deprecition");
    }

    /**
     * 删除折旧车辆
     * @param obj
     * @param column
     * @return
     */
    public int deleteVehicleDeprecition(Object obj,String column){
        return vehicleDeprecitiondao.delByIdUtil(obj,"vehicle_deprecition",column);

    }

    /**
     * 修改折旧车辆
     * @return
     */
    public int update(VehicleDeprecition vehicleDeprecition){
        return  vehicleDeprecitiondao.updateByidUtil(vehicleDeprecition,"vehicle_deprecition");
    }

    /**
     * 查询结果返回单条记录
     * @param selectmap
     * @return
     */
    public VehicleDeprecition selectUserByOne(VehicleDeprecition vehicleDeprecition, Map<String, Object> selectmap){
        return vehicleDeprecitiondao.selectONE(vehicleDeprecition,"vehicle_deprecition",selectmap);
    }

    /**
     * 查询结果返回多条记录
     * @param selectmap
     * @return
     */
    public List<VehicleDeprecition> selectUserByCondition(VehicleDeprecition vehicleDeprecition, Map<String,
            Object> selectmap){
        return  vehicleDeprecitiondao.selectAll(vehicleDeprecition,"vehicle_deprecition",selectmap);
    }
}
